#include "../RealtimeUI/ServerControl.hpp"
#include <iostream>

void PrintHelp()
{
  std::cout<<R"(
    0: Exit
    1: StartMonitor
    2: StopMonitor
    3: StartRecord [projectName] [taskName]
    4: StopRecord
  )"<<std::endl;
}

int main()
{
  std::string serverIP,port;
  std::cout<<"Please input IPaddr: ";
  std::cin>>serverIP;
  std::cout<<"Please input port: ";
  std::cin>>port;
  ServerControl serverControl(serverIP,port);
  int caseInt;
  while(true)
  {
    PrintHelp();
    std::cout<<"Input num: ";
    std::cin>>caseInt;
    switch(caseInt)
    {
      case 0:
        return 0;
      break;

      case 1:
        serverControl.StartMonitor();
      break;

      case 2:
        serverControl.StopMonitor();
      break;

      case 3:
        {
          std::string projectName,taskName;
          std::cout<<"Input ProjectName";
          std::cin>>projectName;
          std::cout<<"Input TaskName";
          std::cin>>taskName;
          serverControl.StartRecord(projectName,taskName);
        }
      break;

      case 4:
        serverControl.StopRecord();
      break;
    }
  }
}
